﻿// Fill out your copyright notice in the Description page of Project Settings.


#include "MyActor.h"

// Sets default values
AMyActor::AMyActor()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AMyActor::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AMyActor::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

void AMyActor::DecreaseHealth_Implementation(int value) {
  Health -= value;
}

void AMyActor::AppendToSpecialName(const FString &Suffix) {
  SpecialName += TEXT("_") + Suffix;
}

void AMyActor::OnSpecialNameChangedNative_Implementation(
    const FString &NewName) {
  UE_LOG(LogTemp, Warning, TEXT("Health changed to: %s"), *NewName);
  // 如果需要，蓝图中没重写也能调用
  OnSpecialNameChanged(NewName);
}

